package com.wjb.web.backend;

<<<<<<< HEAD


import com.wjb.model.EbNews;
import com.wjb.service.NewsService;
=======
import com.wjb.model.EbNews;
import com.wjb.model.EbProduct;
import com.wjb.model.EbProductCategory;
import com.wjb.service.ProductCategoryService;
import com.wjb.model.EbProduct;
import com.wjb.service.ProductService;
>>>>>>> a51c92e5878fafca5f9e81825229ec1434dceb62
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/index")
public class IndexController {
    @Autowired
    private NewsService newsService;


<<<<<<< HEAD

    @RequestMapping("/manage")
    public String manage(){
        return "manage/index";
    }




}



=======
    @Autowired
    private ProductService productService;


    @RequestMapping("/manage")



    public String manage() {
//            WEB-INF/manage/Index.jsp
        return "manage/index";
    }

//    @Autowired
//    private ProductService ProductService;
//
//    @RequestMapping("/front")
//    public String front(Model model) {
//        List<EbProduct> ebProducts = ProductService.selectByPage(EasyBuyEnum.FRONT_INDEX_DEFAULT_PAGE,
//                EasyBuyEnum.FRONT_INDEX_DEFAULT_PAGESIZE);
//        if (ebProducts != null && ebProducts.size() > 0) {
//            model.addAttribute("ebProduct", ebProducts);
//        }
//        return "index";
//    }

    @RequestMapping("/front")
    public String front(Model model){
        //1.调用service层的分页查询商品数据的方法
        List<EbProduct> productList = productService.listByPage(1, 8);
        model.addAttribute("products",productList);
        //4.最近浏览(不做)

        return "index";
    }

}
>>>>>>> a51c92e5878fafca5f9e81825229ec1434dceb62
